/*
 * spi_peripherals.h
 *
 *  Created on: 25.05.2012
 *      Author: Roman Leitner
 */

#ifndef SPI_PERIPHERALS_H_
#define SPI_PERIPHERALS_H_

typedef enum
{
  SPI_ERROR_OK = 0,               // Everything executed normally
  SPI_ERROR_I2C_INIT,             // Unable to initialise I2C
  SPI_ERROR_I2C_BUSY,             // I2C already in use
  SPI_ERROR_I2C_BUFFEROVERFLOW,   // I2C Buffer is too small
  SPI_ERROR_LAST
}
spi_Error_t;

// AS1107 Register definition
#define AS1107_REG_NoOp	        0x00
#define AS1107_REG_Digit0       0x01
#define AS1107_REG_Digit1       0x02
#define AS1107_REG_Digit2       0x03
#define AS1107_REG_Digit3       0x04
#define AS1107_REG_Digit4       0x05
#define AS1107_REG_Digit5       0x06
#define AS1107_REG_Digit6       0x07
#define AS1107_REG_Digit7       0x08
#define AS1107_REG_DecodeMode   0x09
#define AS1107_REG_Intensity    0x0a
#define AS1107_REG_ScanLimit    0x0b
#define AS1107_REG_Shutdown     0x0c

#define AS1107_REG_Feature      0x0d
#define AS1107_REG_DisplayTest  0x0f


// AS1107 Register value definition
#define AS1107_DisplayNormalMode  0x00
#define AS1107_DisplayTestMode    0x01


#endif /* SPI_PERIPHERALS_H_ */
